home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib25 / _cmpsf2.s < prev    next >
Text File  |  1992-12-12  |  854b  |  50 lines

  1. | single floating point compare routine
  2. |
  3. | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  4. | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  5. |
  6. |
  7. | Revision 1.1, kub 12-89 :
  8. | Created single float version for 68000
  9. |
  10. | Revision 1.0:
  11. | original 8088 code from P.S.Housel for double floats
  12.  
  13.     .text
  14.     .even
  15.     .globl    __cmpsf2, ___cmpsf2
  16.     | additional entry points for gcc2
  17.     .globl    ___eqsf2, ___nesf2, ___gtsf2, ___gesf2, ___ltsf2, ___lesf2
  18.  
  19. __cmpsf2:
  20. ___cmpsf2:
  21. ___eqsf2:
  22. ___nesf2:
  23. ___gtsf2:
  24. ___gesf2:
  25. ___ltsf2:
  26. ___lesf2:
  27.     moveml    sp@(4),d0-d1    | get u and v
  28.     tstl    d1        | check sign bit
  29.     bpl    1f
  30.     negl    d1        | negate
  31.     bchg    #31,d1        | toggle sign bit
  32. 1:
  33.     tstl    d0        | check sign bit
  34.     bpl    2f
  35.     negl    d0        | negate
  36.     bchg    #31,d0        | toggle sign bit
  37. 2:
  38.     cmpl    d1,d0
  39.     blt    lt
  40.     bgt    gt
  41. eq:
  42.     clrl    d0
  43.     rts
  44. lt:
  45.     moveq    #-1,d0
  46.     rts
  47. gt:
  48.     moveq    #1,d0
  49.     rts
  50.